package com.yuba.front.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuba.front.domain.FishSiteComments;
import com.yuba.front.domain.vo.FishSiteCommentsVo;
import com.yuba.common.mybatis.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 钓场评论Mapper接口
 *
 * @author modakai
 * @date 2024-12-11
 */
public interface FishSiteCommentsMapper extends BaseMapperPlus<FishSiteComments, FishSiteCommentsVo> {

    @Select("""
                 select fish_site_comments.comments_id,\s
                         fish_site_comments.fish_site_id,\s
                         fish_site_comments.user_id,\s
                         fish_site_comments.comment,\s
                         fish_site_comments.rating,
                         front_user.nickname as username,
                         front_user.avatar,
                        fish_site_comments.create_time
                 from\s
                         fish_site_comments\s
                 join front_user on fish_site_comments.user_id = front_user.user_id
                where fish_site_id = #{fishSiteId}
            \s""")
    Page<FishSiteCommentsVo> selectVoPage(@Param("page") Page<FishSiteCommentsVo> page, @Param("fishSiteId") Integer fishSiteId);
}
